package com.lsa.letcode.the128.longestConseq;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class LongestConseqTest {
	@Test
	public void test() throws Exception {
		test(new int[] { 100, 4, 200, 1, 3, 2 }, 0, 4);
		test(new int[] { 1, 3, 2 }, 0, 3);
		test(new int[] { 1, 2, 3, 4, 5 }, 0, 5);
		test(new int[] { 1, 2, 3, 4 }, 0, 4);
		test(new int[] { 1, 1, 2, 3, 2, 3, 3, 5, 6, }, 0, 3);
		test(new int[] { 1, 2 }, 0, 2);
		test(new int[] { 1 }, 0, 1);
		test(new int[] { 1, 100, 2, 101, 3, 102, 4, 103, 6, 104 }, 99, 104);
		test(new int[] { 100, 3, 3, 102, 103, 1, 2, 2, 2, 2, 4, 106, 107 }, 0,
				4);
	}

	private void test(int[] input, int expectedFrom, int expectedTo) {
		Solution s = new Solution();
		
		assertEquals(new Solution.Run(expectedFrom, expectedTo), s.doLongestConsecutive(input));
	}
	
	@Test
	public void testName() throws Exception {
		
	}
}